<script type="text/javascript" src="javascript/ajax/prototype.js"></script>
<link rel="stylesheet" type="text/css" href="modules/IShopStore/pnjavascript/ddtabmenu/ddtabmenufiles/ddcolortabs_blue.css" />
</style>

<script type="text/javascript">
  function validateForm(form) {

    //Check bank name
    var bank_name = document.getElementById("form_payment_bank_name_");
    if (bank_name.selectedIndex == 0) {
        alert("Please select bank name.");
        bank_name.style.background = 'PowderBlue';
        bank_name.focus();
        return false;
    }

    //Check bank branch
    var bank_branch = document.getElementById("form_payment_bank_branch_");
    if (bank_branch.value == '') {
        alert("Please Enter bank branch.");
        bank_branch.style.background = 'PowderBlue';
        bank_branch.focus();
        return false;
    }

    //Check account name
    var account_name = document.getElementById("form_bank_account_name_");
    if (account_name.value == '') {
        alert("Please Enter account name.");
        account_name.style.background = 'PowderBlue';
        account_name.focus();
        return false;
    }

    //Check account type
    var account_type = document.getElementById("form_payment_bank_account_type_");
    if (account_type.selectedIndex == 0) {
        alert("Please select account type.");
        account_type.style.background = 'PowderBlue';
        account_type.focus();
        return false;
    }


    //Check account name


    var account_no = document.getElementById("form_payment_bank_account_no_");
    if (account_no.selectedIndex == 0) {
        alert("Please Enter account no.");
        account_no.style.background = 'PowderBlue';
        account_no.focus();
        return false;
    }


  }
</script>



<div id="ddtabs" class="ddcolortabs">
  <ul>
    <li><a href="<!--[pnmodurl modname='IShopStore' type='admin' func='page' ctrl='home']-->" rel="ct1"><span>หน้าหลัก</span></a></li>
    <li><a href="<!--[pnmodurl modname='IShopStore' type='admin' func='list' ctrl='payment']-->" rel="ct1">
    <span>กลับ</span></a></li>
  </ul>
</div>
<div class="ddcolortabsline">&nbsp;</div>
<!-- end tab menu -->


<fieldset>
<h4 class="innodocument-head">เพิ่ม / แก้ไข บัญชีธนาคาร</h4>

<form id='form' class='form' action="<!--[pnmodurl modname='IShopStore' type='adminform' func='submit' ctrl='Payment']-->" method="post" enctype="multipart/form-data" onsubmit="return validateForm(this)">
<input type="hidden" name="form[id]" value="<!--[$_GET.id]-->" />

<TABLE width='50%' border="0" class="innoadvert-table">
<TR  >
  <TD class='td-label' width='30%'>ธนาคาร</TD>
  <TD>
      <!--[if $item.payment_bank_name != '']-->
        <!--[$item.payment_bank_name]-->
      <!--[else]-->
       <select name="form[payment_bank_name]" id="form_payment_bank_name_" size="1">
          <option value="0" selected="selected">-เลือกธนาคาร-</option>
          <option value="กรุงศรีอยุธยา">กรุงศรีอยุธยา</option>
          <option value="กรุงเทพ">กรุงเทพ</option>
          <option value="ออมสิน">ออมสิน</option>
          <option value="กสิกรไทย">กสิกรไทย</option>
          <option value="กรุงไทย">กรุงไทย</option>
          <option value="ไทยพาณิชย์">ไทยพาณิชย์</option>
          <option value="ทหารไทย">ทหารไทย</option>
          <option value="ยูโอบี">ยูโอบี</option>
      </select>
      <!--[/if]-->
  </TD>
</TR>
<tr>
  <td class='td-label' >สาขา</td>
  <td class='td-data' ><input name="form[payment_bank_branch]" 
                 id="form_payment_bank_branch_" 
                 type="text" 
                 size="40" 
                 value="<!--[$form.payment_bank_branch]-->" /></td>
</tr>
<tr>
  <td class='td-label' >ชื่อบัญชี</td>
  <td class='td-data' ><input name="form[payment_bank_account_name]" 
                 id="form_bank_account_name_" 
                 type="text" 
                 size="40" 
                 value="<!--[$form.payment_bank_account_name]-->" /></td>
</tr>
<tr>
  <td class='td-label' >ประเภทบัญญชี</td>
  <td class='td-data' >
    <select name="form[payment_bank_account_type]" id="form_payment_bank_account_type_">
      <option value="" selected="selected">-เลือกประเภท-</option>
      <option value="ออมทรัพย์">ออมทรัพย์</option>
      <option value="สะสมทรัพย์">สะสมทรัพย์</option>
      <option value="กระแสรายวัน">กระแสรายวัน</option>
      <option value="ฝากประจำ">ฝากประจำ</option></select></td>
</tr>
<tr>
  <td class='td-label' >เลขบัญชี</td>
  <td class='td-data' ><input name="form[payment_bank_account_no]" 
                 id="form_payment_bank_account_no_" 
                 type="text" 
                 size="20" 
                 value="<!--[$form.payment_bank_account_no]-->" />

  </td>
</tr>
<TR>
  <TD></TD>
  <TD><!--[if $form.id]--><INPUT TYPE="submit" value='Update' name='Update' type="submit" >&nbsp;&nbsp;<!--[/if]-->
      <!--[if $form.id==null]--><INPUT TYPE="submit" value='Submit' name='Submit' type="submit" >&nbsp;&nbsp;<!--[/if]--></TD>
</TR>
</TABLE>

</form>
</fieldset>